package com.bbc.commonbackstage.common.mybatisplus.base;


import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * POJO基类
 *
 * @author liac
 * @date 2022/4/6
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("POJO基类")
public abstract class BaseEntity extends Entity {

    /** 主键ID */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty("id")
    protected Long id;

    /** 版本号 */
    @Version
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty("版本号")
    protected Integer version;

    /** 删除标志 */
    @ApiModelProperty(value = "删除标识", notes = "0-正常，1-已删除，默认0")
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    protected Boolean delFlag;

    protected BaseEntity() {}

}
